Skip to content

Inscoper::RecipeElementSimple

RecipeElementSimple class represents a basic recipe step with actions and conditions. More...

#include <RecipeElementSimple.h>

Inherits from Inscoper::RecipeElement

Public Functions

Name
RecipeElementSimple()
Default constructor.
virtual ~RecipeElementSimple()
Default destructor.
virtual void fromXML(Inscoper::XMLNode & xml) override
Load from XML.
virtual void toXML(Inscoper::XMLNode & xmlParent) override
Save to XML.
virtual Inscoper::ERecipeElementType getType() override
Get the element type.
const std::string & getDescription() const
Get the description.
void setDescription(const std::string & description)
Set the description.
const Inscoper::SubDeviceId getSubDeviceId() const
Get the sub-device ID.
void setSubDeviceId(const Inscoper::SubDeviceId subDeviceId)
Set the sub-device ID.
const std::string & getRecipeId() const
Get the recipe ID.
void setRecipeId(const std::string & recipeId)
Set the recipe ID.
Inscoper::EFunctionType getFunction() const
Get the function type.
void setFunction(Inscoper::EFunctionType function)
Set the function type.
const std::string & getValue() const
Get the value.
void setValue(const std::string & value)
Set the value.
bool getImage() const
Check if this element will generate an image.
void setImage(bool image)
Set the image generation flag.
const std::vector< Inscoper::ValueConditionPtr > & getValueConditionList() const
Get value conditions.
void setValueConditionList(const std::vector< Inscoper::ValueConditionPtr > & valueConditionList)
Set value conditions.
void addValueCondition(const Inscoper::ValueConditionPtr & valueCondition)
Add a value condition.
const std::string & getTagCondition() const
Get the tag condition.
void setTagCondition(const std::string & tagCondition)
Set the tag condition.
bool getOptimisation() const
Check the optimization flag.
void setOptimisation(bool optimisation)
Set the optimization flag.
bool hasValueCondition()
Check for value conditions.
const std::string & getCallId()
Get the call ID.
void setCallId(const std::string & callId)
Set the call ID.
void addOnCallSubRecipes(const std::vector< std::shared_ptr< RecipeElementSimple > > & elems)
Add recipe elements to notify on call.
void addOnCallSubRecipe(const std::shared_ptr< RecipeElementSimple > & elem)
Add a recipe element to notify on call.
std::vector< std::string > getDependencies()
Get the list of recipe element call IDs that will, when called, notify this recipe element.
void setRecipeCalled(const std::string & id)
Set the recipe element as called.
const std::string & getRecipeCallCondition()
Get recipe call condition.
void setRecipeCallCondition(const std::string & recipeCallCondition)
Set recipe call condition.
std::map< std::string, bool > & getRecipeCallState()
Get recipe call states.
const std::vector< std::shared_ptr< RecipeElementSimple > > & getRecipeCallSubRecipes()
Get the recipe elements to notify when this element is called.

Detailed Description

class Inscoper::RecipeElementSimple;

RecipeElementSimple class represents a basic recipe step with actions and conditions.

Note: This class is non-copyable and non-movable.

This is the main recipe element type, supporting actions on sub-devices, conditional execution based on tags or values, and optimization settings.

Public Functions Documentation

function RecipeElementSimple

RecipeElementSimple()

Default constructor.

Initializes a new instance of the RecipeElementSimple class.

function ~RecipeElementSimple

virtual ~RecipeElementSimple()

Default destructor.

function fromXML

virtual void fromXML(
    Inscoper::XMLNode & xml
) override

Load from XML.

Parameters:

  • xml : The XML node containing the simple recipe element

Exceptions:

Reimplements: Inscoper::RecipeElement::fromXML

Populates the simple recipe element from an XML node.

function toXML

virtual void toXML(
    Inscoper::XMLNode & xmlParent
) override

Save to XML.

Parameters:

  • xmlParent : The parent XML node

Exceptions:

Reimplements: Inscoper::RecipeElement::toXML

Exports the simple recipe element to an XML node attached to the parent XML node.

function getType

virtual Inscoper::ERecipeElementType getType() override

Get the element type.

Return: The type (SIMPLE)

Reimplements: Inscoper::RecipeElement::getType

Retrieves the type of this recipe element.

function getDescription

const std::string & getDescription() const

Get the description.

Return: The description

Retrieves the description of the recipe element.

function setDescription

void setDescription(
    const std::string & description
)

Set the description.

Parameters:

  • description : The description

Sets the description of the recipe element.

function getSubDeviceId

const Inscoper::SubDeviceId getSubDeviceId() const

Get the sub-device ID.

Return: The sub-device ID

Retrieves the ID of the sub-device associated with this element.

function setSubDeviceId

void setSubDeviceId(
    const Inscoper::SubDeviceId subDeviceId
)

Set the sub-device ID.

Parameters:

  • subDeviceId : The sub-device ID

Sets the ID of the sub-device associated with this element.

function getRecipeId

const std::string & getRecipeId() const

Get the recipe ID.

Return: The recipe ID

Retrieves the identifier of the recipe element.

function setRecipeId

void setRecipeId(
    const std::string & recipeId
)

Set the recipe ID.

Parameters:

  • recipeId : The recipe ID

Sets the identifier of the recipe element.

function getFunction

Inscoper::EFunctionType getFunction() const

Get the function type.

Return: The function type

Retrieves the function type to be executed on the sub-device.

function setFunction

void setFunction(
    Inscoper::EFunctionType function
)

Set the function type.

Parameters:

  • function : The function type

Sets the function type to be executed on the sub-device.

function getValue

const std::string & getValue() const

Get the value.

Return: The value

Retrieves the parameter value associated with the function call.

function setValue

void setValue(
    const std::string & value
)

Set the value.

Parameters:

  • value : The value

Sets the parameter value associated with the function call.

function getImage

bool getImage() const

Check if this element will generate an image.

Return: True if an image will be generated, false otherwise

Determines if the function to be called by the element generates an image.

function setImage

void setImage(
    bool image
)

Set the image generation flag.

Parameters:

  • image : True if an image will be generated, false otherwise

Sets whether the function to be called will generate an image.

function getValueConditionList

const std::vector< Inscoper::ValueConditionPtr > & getValueConditionList() const

Get value conditions.

Return: The list of value conditions

Retrieves the list of value conditions that must be met for this element to execute.

function setValueConditionList

void setValueConditionList(
    const std::vector< Inscoper::ValueConditionPtr > & valueConditionList
)

Set value conditions.

Parameters:

  • valueConditionList : The list of value conditions

Sets the list of value conditions that must be met for this element to execute.

function addValueCondition

void addValueCondition(
    const Inscoper::ValueConditionPtr & valueCondition
)

Add a value condition.

Parameters:

  • valueCondition : The value condition to add

Adds a value condition to the list.

function getTagCondition

const std::string & getTagCondition() const

Get the tag condition.

Return: The tag condition

Retrieves the tag condition required for execution.

function setTagCondition

void setTagCondition(
    const std::string & tagCondition
)

Set the tag condition.

Parameters:

  • tagCondition : The tag condition

Sets the tag condition required for execution.

function getOptimisation

bool getOptimisation() const

Check the optimization flag.

Return: True if optimization is enabled, false otherwise

Determines if optimization is enabled for this element.

function setOptimisation

void setOptimisation(
    bool optimisation
)

Set the optimization flag.

Parameters:

  • optimisation : True to enable optimization, false to disable

Enables or disables optimization for this element.

function hasValueCondition

bool hasValueCondition()

Check for value conditions.

Return: True if value conditions exist, false otherwise

Returns whether there are value conditions associated with this recipe element.

function getCallId

const std::string & getCallId()

Get the call ID.

Return: The call ID

Retrieves the call ID associated with this element.

function setCallId

void setCallId(
    const std::string & callId
)

Set the call ID.

Parameters:

  • callId : The call ID

Sets the call ID associated with this element.

function addOnCallSubRecipes

void addOnCallSubRecipes(
    const std::vector< std::shared_ptr< RecipeElementSimple > > & elems
)

Add recipe elements to notify on call.

Parameters:

  • elems : The list of recipe elements to add

Adds a list of simple recipe elements to notify when this recipe element is called.

function addOnCallSubRecipe

void addOnCallSubRecipe(
    const std::shared_ptr< RecipeElementSimple > & elem
)

Add a recipe element to notify on call.

Parameters:

  • elem : The recipe element to add

Adds a simple recipe element to notify when this recipe element is called.

function getDependencies

std::vector< std::string > getDependencies()

Get the list of recipe element call IDs that will, when called, notify this recipe element.

Return: The list of recipe element call IDs

Retrieves the list of recipe element call IDs that will, when called, notify this recipe element.

function setRecipeCalled

void setRecipeCalled(
    const std::string & id
)

Set the recipe element as called.

Parameters:

  • id : The call ID of the recipe element

Marks the recipe associated to the call ID as called.

function getRecipeCallCondition

const std::string & getRecipeCallCondition()

Get recipe call condition.

Return: The recipe call condition

Retrieves the call condition of the recipe.

function setRecipeCallCondition

void setRecipeCallCondition(
    const std::string & recipeCallCondition
)

Set recipe call condition.

Parameters:

  • recipeCallCondition : The recipe call condition

Sets the call condition of the recipe.

function getRecipeCallState

std::map< std::string, bool > & getRecipeCallState()

Get recipe call states.

Return: A map pairing the call ID with the execution state

Retrieves the states of recipe calls.

function getRecipeCallSubRecipes

const std::vector< std::shared_ptr< RecipeElementSimple > > & getRecipeCallSubRecipes()

Get the recipe elements to notify when this element is called.

Return: The list of recipe elements

Retrieves the list of recipe elements to notify when this element is called.


Updated on 2026-04-02 at 10:55:36 +0200